<template>
  <div class="card">
    <div class="header">
        <div class="title">{{ title }}</div>
        <slot name="extra"/>
    </div>
    <div :class="['content', bodyClass]">
        <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
    name: 'Card',
    props: {
        title: {
            type: String,
            required: true
        },
        bodyClass: {
            type: String,
            default: ''
        }
    },
  data() {
    return {}
  },
  computed: {},
  mounted() {},
  methods: {}
}
</script>

<style lang="scss" scoped>
.card{
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,.1);
    border: 1px solid #f0f0f0;
    height: 100%;
    .header{
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px;
        font-size: 16px;
        font-weight: 500;
        color: #333;
        border-bottom: 1px solid #f0f0f0;
        .title{
            display: flex;
            align-items: center;
            gap: 8px;
            &::before{
                content: "";
                display: block;
                width: 3px;
                height: 16px;
                background-color: #3A71A8;
            }
        }
    }
    .content{
        flex: auto;
        padding: 12px;
    }
}
</style>